package com.waiting.reflection;

/**
 * @Description
 * @Author bjweitingting
 * @Date 2019/2/25
 **/
public class Test2 {
    public static void main(String[] args) {
        Author wanger = new Writer();
        Class c1 = wanger.getClass();
        System.out.println(c1.getName());
        //输出 com.cmower.java_demo.fifteen.Writer
        Author wangerTest = (Author) new Writer();
        Class c2 = wangerTest.getClass();
        System.out.println(c2.getName());
    }
}

class Author {
    private String pen_name;
    private String real_name;
}

class Writer extends Author {
    private String honour;
}